<?php

/**
 * ApplicationCorporateIndividual form base class.
 *
 * @method ApplicationCorporateIndividual getObject() Returns the current form's model object
 *
 * @package    digitalform
 * @subpackage form
 * @author     Saul Santiago
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseApplicationCorporateIndividualForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                                    => new sfWidgetFormInputHidden(),
      'ref_number'                            => new sfWidgetFormInputText(),
      'existing_subscriber'                   => new sfWidgetFormInputCheckbox(),
      'globe_mobile_access_code'              => new sfWidgetFormInputText(),
      'globe_mobile_phone_number'             => new sfWidgetFormInputText(),
      'globe_telephone_access_code'           => new sfWidgetFormInputText(),
      'globe_telephone_phone_number'          => new sfWidgetFormInputText(),
      'others_subscriber'                     => new sfWidgetFormInputText(),
      'sex'                                   => new sfWidgetFormChoice(array('choices' => array('MALE' => 'MALE', 'FEMALE' => 'FEMALE'))),
      'last_name'                             => new sfWidgetFormInputText(),
      'first_name'                            => new sfWidgetFormInputText(),
      'middle_name'                           => new sfWidgetFormInputText(),
      'birthday'                              => new sfWidgetFormDate(),
      'mothers_maiden_name'                   => new sfWidgetFormInputText(),
      'home_ownership'                        => new sfWidgetFormChoice(array('choices' => array('OWNED' => 'OWNED', 'LIVING WITH RELATIVES' => 'LIVING WITH RELATIVES', 'COMPANY-OWNED' => 'COMPANY-OWNED', 'RENTED' => 'RENTED', 'MORTGAGE' => 'MORTGAGE'))),
      'rented_per_month'                      => new sfWidgetFormInputText(),
      'mortgage_per_month'                    => new sfWidgetFormInputText(),
      'years_of_stay'                         => new sfWidgetFormInputText(),
      'home_address'                          => new sfWidgetFormInputText(),
      'home_brgy_municipality_town'           => new sfWidgetFormInputText(),
      'home_city_province'                    => new sfWidgetFormInputText(),
      'home_postal_code_zip_code'             => new sfWidgetFormInputText(),
      'home_telephone_number'                 => new sfWidgetFormInputText(),
      'email_address'                         => new sfWidgetFormInputText(),
      'tin'                                   => new sfWidgetFormInputText(),
      'gsis_sss'                              => new sfWidgetFormInputText(),
      'citizenship'                           => new sfWidgetFormInputText(),
      'foreigner_country'                     => new sfWidgetFormInputText(),
      'passport_number'                       => new sfWidgetFormInputText(),
      'acr_number'                            => new sfWidgetFormInputText(),
      'passport_expiry_date'                  => new sfWidgetFormDate(),
      'civil_status'                          => new sfWidgetFormChoice(array('choices' => array('SINGLE' => 'SINGLE', 'MARRIED' => 'MARRIED', 'WIDOW/WIDOWER' => 'WIDOW/WIDOWER', 'LEGALLY SEPARATED' => 'LEGALLY SEPARATED'))),
      'spouse_name'                           => new sfWidgetFormInputText(),
      'spouse_birthday'                       => new sfWidgetFormDate(),
      'spouse_profession_company_name'        => new sfWidgetFormInputText(),
      'spouse_position'                       => new sfWidgetFormInputText(),
      'spouse_telephone_number'               => new sfWidgetFormInputText(),
      'employer_business_name'                => new sfWidgetFormInputText(),
      'industry'                              => new sfWidgetFormInputText(),
      'business_address'                      => new sfWidgetFormInputText(),
      'business_brgy_municipality_town'       => new sfWidgetFormInputText(),
      'business_city_province'                => new sfWidgetFormInputText(),
      'business_postal_code_zip_code'         => new sfWidgetFormInputText(),
      'office_telephone_number'               => new sfWidgetFormInputText(),
      'years_in_company'                      => new sfWidgetFormInputText(),
      'current_position_held'                 => new sfWidgetFormInputText(),
      'personal_monthly_income'               => new sfWidgetFormChoice(array('choices' => array('BELOW P10,000' => 'BELOW P10,000', 'P10,000 - P24,999' => 'P10,000 - P24,999', 'P25,000 - P34,999' => 'P25,000 - P34,999', 'ABOVE P35,000' => 'ABOVE P35,000'))),
      'authorized_contact_person'             => new sfWidgetFormInputText(),
      'authorized_contact_relation'           => new sfWidgetFormInputText(),
      'authorized_contact_number'             => new sfWidgetFormInputText(),
      'bills_sent_to'                         => new sfWidgetFormChoice(array('choices' => array('HOME ADDRESS' => 'HOME ADDRESS', 'BUSINESS ADDRESS' => 'BUSINESS ADDRESS'))),
      'plans_gplan'                           => new sfWidgetFormInputText(),
      'plans_gflex'                           => new sfWidgetFormInputText(),
      'plans_others'                          => new sfWidgetFormInputText(),
      'promo'                                 => new sfWidgetFormInputText(),
      'value_added_service_special_features'  => new sfWidgetFormInputText(),
      'handset_brand_model'                   => new sfWidgetFormInputText(),
      'handset_provided_by'                   => new sfWidgetFormChoice(array('choices' => array('GLOBE TELECOM' => 'GLOBE TELECOM', 'SUBSCRIBER' => 'SUBSCRIBER'))),
      'handset_imei_number'                   => new sfWidgetFormInputText(),
      'handset_hbp'                           => new sfWidgetFormInputText(),
      'handset_lockup_period'                 => new sfWidgetFormInputText(),
      'sim_card_number'                       => new sfWidgetFormInputText(),
      'authorized_person_to_receive_delivery' => new sfWidgetFormInputText(),
      'complete_delivery_address'             => new sfWidgetFormInputText(),
      'bulk_service'                          => new sfWidgetFormInputText(),
      'max_authorized_recipients'             => new sfWidgetFormInputText(),
      'distribution_type'                     => new sfWidgetFormChoice(array('choices' => array('EQUAL' => 'EQUAL', 'PRIORITIZATION' => 'PRIORITIZATION'))),
      'nominated_postpaid_charging_account'   => new sfWidgetFormInputText(),
      'corporate_id'                          => new sfWidgetFormInputText(),
      'status'                                => new sfWidgetFormChoice(array('choices' => array('COMPLETION' => 'COMPLETION', 'PROCESSING' => 'PROCESSING', 'ACTIVATED' => 'ACTIVATED'))),
      'deleted'                               => new sfWidgetFormInputCheckbox(),
      'created_at'                            => new sfWidgetFormDateTime(),
      'updated_at'                            => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'ref_number'                            => new sfValidatorString(array('max_length' => 25)),
      'existing_subscriber'                   => new sfValidatorBoolean(array('required' => false)),
      'globe_mobile_access_code'              => new sfValidatorString(array('max_length' => 4, 'required' => false)),
      'globe_mobile_phone_number'             => new sfValidatorString(array('max_length' => 7, 'required' => false)),
      'globe_telephone_access_code'           => new sfValidatorString(array('max_length' => 4, 'required' => false)),
      'globe_telephone_phone_number'          => new sfValidatorString(array('max_length' => 7, 'required' => false)),
      'others_subscriber'                     => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'sex'                                   => new sfValidatorChoice(array('choices' => array(0 => 'MALE', 1 => 'FEMALE'), 'required' => false)),
      'last_name'                             => new sfValidatorString(array('max_length' => 150)),
      'first_name'                            => new sfValidatorString(array('max_length' => 150)),
      'middle_name'                           => new sfValidatorString(array('max_length' => 150)),
      'birthday'                              => new sfValidatorDate(),
      'mothers_maiden_name'                   => new sfValidatorString(array('max_length' => 150)),
      'home_ownership'                        => new sfValidatorChoice(array('choices' => array(0 => 'OWNED', 1 => 'LIVING WITH RELATIVES', 2 => 'COMPANY-OWNED', 3 => 'RENTED', 4 => 'MORTGAGE'), 'required' => false)),
      'rented_per_month'                      => new sfValidatorInteger(array('required' => false)),
      'mortgage_per_month'                    => new sfValidatorInteger(array('required' => false)),
      'years_of_stay'                         => new sfValidatorInteger(array('required' => false)),
      'home_address'                          => new sfValidatorPass(),
      'home_brgy_municipality_town'           => new sfValidatorString(array('max_length' => 150)),
      'home_city_province'                    => new sfValidatorString(array('max_length' => 150)),
      'home_postal_code_zip_code'             => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'home_telephone_number'                 => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'email_address'                         => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'tin'                                   => new sfValidatorString(array('max_length' => 150)),
      'gsis_sss'                              => new sfValidatorString(array('max_length' => 150)),
      'citizenship'                           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'foreigner_country'                     => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'passport_number'                       => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'acr_number'                            => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'passport_expiry_date'                  => new sfValidatorDate(array('required' => false)),
      'civil_status'                          => new sfValidatorChoice(array('choices' => array(0 => 'SINGLE', 1 => 'MARRIED', 2 => 'WIDOW/WIDOWER', 3 => 'LEGALLY SEPARATED'), 'required' => false)),
      'spouse_name'                           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'spouse_birthday'                       => new sfValidatorDate(array('required' => false)),
      'spouse_profession_company_name'        => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'spouse_position'                       => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'spouse_telephone_number'               => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'employer_business_name'                => new sfValidatorString(array('max_length' => 150)),
      'industry'                              => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'business_address'                      => new sfValidatorPass(),
      'business_brgy_municipality_town'       => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'business_city_province'                => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'business_postal_code_zip_code'         => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'office_telephone_number'               => new sfValidatorString(array('max_length' => 150)),
      'years_in_company'                      => new sfValidatorInteger(),
      'current_position_held'                 => new sfValidatorString(array('max_length' => 150)),
      'personal_monthly_income'               => new sfValidatorChoice(array('choices' => array(0 => 'BELOW P10,000', 1 => 'P10,000 - P24,999', 2 => 'P25,000 - P34,999', 3 => 'ABOVE P35,000'), 'required' => false)),
      'authorized_contact_person'             => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'authorized_contact_relation'           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'authorized_contact_number'             => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'bills_sent_to'                         => new sfValidatorChoice(array('choices' => array(0 => 'HOME ADDRESS', 1 => 'BUSINESS ADDRESS'), 'required' => false)),
      'plans_gplan'                           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'plans_gflex'                           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'plans_others'                          => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'promo'                                 => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'value_added_service_special_features'  => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'handset_brand_model'                   => new sfValidatorString(array('max_length' => 150)),
      'handset_provided_by'                   => new sfValidatorChoice(array('choices' => array(0 => 'GLOBE TELECOM', 1 => 'SUBSCRIBER'), 'required' => false)),
      'handset_imei_number'                   => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'handset_hbp'                           => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'handset_lockup_period'                 => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'sim_card_number'                       => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'authorized_person_to_receive_delivery' => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'complete_delivery_address'             => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'bulk_service'                          => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'max_authorized_recipients'             => new sfValidatorInteger(array('required' => false)),
      'distribution_type'                     => new sfValidatorChoice(array('choices' => array(0 => 'EQUAL', 1 => 'PRIORITIZATION'), 'required' => false)),
      'nominated_postpaid_charging_account'   => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'corporate_id'                          => new sfValidatorString(array('max_length' => 150, 'required' => false)),
      'status'                                => new sfValidatorChoice(array('choices' => array(0 => 'COMPLETION', 1 => 'PROCESSING', 2 => 'ACTIVATED'), 'required' => false)),
      'deleted'                               => new sfValidatorBoolean(array('required' => false)),
      'created_at'                            => new sfValidatorDateTime(),
      'updated_at'                            => new sfValidatorDateTime(),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'ApplicationCorporateIndividual', 'column' => array('ref_number')))
    );

    $this->widgetSchema->setNameFormat('application_corporate_individual[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ApplicationCorporateIndividual';
  }

}
